#include"c10_T5_stack.h"
#include <iostream>
Stack::Stack()  //create an empty stack
{
	top = 0;
}

/*
Item & getitem()
{
	Item i;
	std::cout << "enter the item informaion in order :\n"
		<< "fullname :_\b";
	std::cin >> i.fullname;
	std::cout << "payment :_\b";
	std::cin >> i.payment;
	return i;
}
*/

bool Stack::isempty() const
{
	return top == 0;
}

bool Stack::isfull() const
{
	return top == MAX;
}

bool Stack::push(const Item & item)
{
	if (top < MAX)
	{
		items[top++] = item;
		return true;
	}
	else
		return false;
}

bool Stack::pop(Item & item)
{
	if (top > 0)
	{
		item = items[--top];
		return true;
	}
	else
		return false;
}